3.1.80 \(\int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx\) [80]

3.1.80.1 Optimal result
3.1.80.2 Mathematica [A] (verified)
3.1.80.3 Rubi [A] (verified)
3.1.80.4 Maple [A] (verified)
3.1.80.5 Fricas [A] (verification not implemented)
3.1.80.6 Sympy [F]
3.1.80.7 Maxima [A] (verification not implemented)
3.1.80.8 Giac [A] (verification not implemented)
3.1.80.9 Mupad [B] (verification not implemented)

3.1.80.1 Optimal result

Integrand size = 26, antiderivative size = 150 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {b^4 \text {arctanh}(\sin (c+d x))}{d}-\frac {4 a b^3 \cos (c+d x)}{d}-\frac {4 a^3 b \cos ^3(c+d x)}{3 d}+\frac {4 a b^3 \cos ^3(c+d x)}{3 d}+\frac {a^4 \sin (c+d x)}{d}-\frac {b^4 \sin (c+d x)}{d}-\frac {a^4 \sin ^3(c+d x)}{3 d}+\frac {2 a^2 b^2 \sin ^3(c+d x)}{d}-\frac {b^4 \sin ^3(c+d x)}{3 d} \]

output
b^4*arctanh(sin(d*x+c))/d-4*a*b^3*cos(d*x+c)/d-4/3*a^3*b*cos(d*x+c)^3/d+4/ 
3*a*b^3*cos(d*x+c)^3/d+a^4*sin(d*x+c)/d-b^4*sin(d*x+c)/d-1/3*a^4*sin(d*x+c 
)^3/d+2*a^2*b^2*sin(d*x+c)^3/d-1/3*b^4*sin(d*x+c)^3/d
 
3.1.80.2 Mathematica [A] (verified)

Time = 2.42 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.21 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {-12 a b \left (a^2+3 b^2\right ) \cos (c+d x)+\left (-4 a^3 b+4 a b^3\right ) \cos (3 (c+d x))-12 b^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 b^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+9 a^4 \sin (c+d x)+18 a^2 b^2 \sin (c+d x)-15 b^4 \sin (c+d x)+a^4 \sin (3 (c+d x))-6 a^2 b^2 \sin (3 (c+d x))+b^4 \sin (3 (c+d x))}{12 d} \]

input
Integrate[Sec[c + d*x]*(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]
 
output
(-12*a*b*(a^2 + 3*b^2)*Cos[c + d*x] + (-4*a^3*b + 4*a*b^3)*Cos[3*(c + d*x) 
] - 12*b^4*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 12*b^4*Log[Cos[(c + 
d*x)/2] + Sin[(c + d*x)/2]] + 9*a^4*Sin[c + d*x] + 18*a^2*b^2*Sin[c + d*x] 
 - 15*b^4*Sin[c + d*x] + a^4*Sin[3*(c + d*x)] - 6*a^2*b^2*Sin[3*(c + d*x)] 
 + b^4*Sin[3*(c + d*x)])/(12*d)
 
3.1.80.3 Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {3042, 3569, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a \cos (c+d x)+b \sin (c+d x))^4}{\cos (c+d x)}dx\)

\(\Big \downarrow \) 3569

\(\displaystyle \int \left (a^4 \cos ^3(c+d x)+4 a^3 b \sin (c+d x) \cos ^2(c+d x)+6 a^2 b^2 \sin ^2(c+d x) \cos (c+d x)+4 a b^3 \sin ^3(c+d x)+b^4 \sin ^3(c+d x) \tan (c+d x)\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {a^4 \sin ^3(c+d x)}{3 d}+\frac {a^4 \sin (c+d x)}{d}-\frac {4 a^3 b \cos ^3(c+d x)}{3 d}+\frac {2 a^2 b^2 \sin ^3(c+d x)}{d}+\frac {4 a b^3 \cos ^3(c+d x)}{3 d}-\frac {4 a b^3 \cos (c+d x)}{d}+\frac {b^4 \text {arctanh}(\sin (c+d x))}{d}-\frac {b^4 \sin ^3(c+d x)}{3 d}-\frac {b^4 \sin (c+d x)}{d}\)

input
Int[Sec[c + d*x]*(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]
 
output
(b^4*ArcTanh[Sin[c + d*x]])/d - (4*a*b^3*Cos[c + d*x])/d - (4*a^3*b*Cos[c 
+ d*x]^3)/(3*d) + (4*a*b^3*Cos[c + d*x]^3)/(3*d) + (a^4*Sin[c + d*x])/d - 
(b^4*Sin[c + d*x])/d - (a^4*Sin[c + d*x]^3)/(3*d) + (2*a^2*b^2*Sin[c + d*x 
]^3)/d - (b^4*Sin[c + d*x]^3)/(3*d)
 

3.1.80.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3569
Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*si 
n[(c_.) + (d_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandTrig[cos[c + d*x]^m*(a 
*cos[c + d*x] + b*sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d}, x] && Inte 
gerQ[m] && IGtQ[n, 0]
 
3.1.80.4 Maple [A] (verified)

Time = 1.31 (sec) , antiderivative size = 116, normalized size of antiderivative = 0.77

method result size
derivativedivides \(\frac {\frac {a^{4} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}-\frac {4 a^{3} b \cos \left (d x +c \right )^{3}}{3}+2 a^{2} b^{2} \sin \left (d x +c \right )^{3}-\frac {4 a \,b^{3} \left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{3}+b^{4} \left (-\frac {\sin \left (d x +c \right )^{3}}{3}-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) \(116\)
default \(\frac {\frac {a^{4} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}-\frac {4 a^{3} b \cos \left (d x +c \right )^{3}}{3}+2 a^{2} b^{2} \sin \left (d x +c \right )^{3}-\frac {4 a \,b^{3} \left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{3}+b^{4} \left (-\frac {\sin \left (d x +c \right )^{3}}{3}-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) \(116\)
parts \(\frac {a^{4} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3 d}+\frac {b^{4} \left (-\frac {\sin \left (d x +c \right )^{3}}{3}-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}-\frac {4 a^{3} b}{3 \sec \left (d x +c \right )^{3} d}+\frac {4 a \,b^{3} \left (\frac {\cos \left (d x +c \right )^{3}}{3}-\cos \left (d x +c \right )\right )}{d}+\frac {2 a^{2} b^{2} \sin \left (d x +c \right )^{3}}{d}\) \(130\)
parallelrisch \(\frac {-12 b^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+12 b^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (a^{4}-6 a^{2} b^{2}+b^{4}\right ) \sin \left (3 d x +3 c \right )+\left (-4 a^{3} b +4 a \,b^{3}\right ) \cos \left (3 d x +3 c \right )+\left (9 a^{4}+18 a^{2} b^{2}-15 b^{4}\right ) \sin \left (d x +c \right )-12 b \left (\left (a^{2}+3 b^{2}\right ) \cos \left (d x +c \right )+\frac {4 a^{2}}{3}+\frac {8 b^{2}}{3}\right ) a}{12 d}\) \(146\)
norman \(\frac {-\frac {8 a^{3} b +16 a \,b^{3}}{3 d}+\frac {2 \left (a^{4}-b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 \left (a^{4}-b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {8 a^{3} b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{d}+\frac {2 \left (5 a^{4}+24 a^{2} b^{2}-13 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}+\frac {2 \left (5 a^{4}+24 a^{2} b^{2}-13 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{3 d}-\frac {4 \left (2 a^{3} b +16 a \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{3 d}-\frac {2 \left (4 a^{3} b +8 a \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}+\frac {b^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {b^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(272\)
risch \(-\frac {{\mathrm e}^{i \left (d x +c \right )} a^{3} b}{2 d}-\frac {3 \,{\mathrm e}^{i \left (d x +c \right )} a \,b^{3}}{2 d}-\frac {3 i {\mathrm e}^{i \left (d x +c \right )} a^{4}}{8 d}-\frac {5 i {\mathrm e}^{-i \left (d x +c \right )} b^{4}}{8 d}+\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} a^{4}}{8 d}-\frac {{\mathrm e}^{-i \left (d x +c \right )} a^{3} b}{2 d}-\frac {3 \,{\mathrm e}^{-i \left (d x +c \right )} a \,b^{3}}{2 d}+\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} a^{2} b^{2}}{4 d}+\frac {5 i {\mathrm e}^{i \left (d x +c \right )} b^{4}}{8 d}-\frac {3 i {\mathrm e}^{i \left (d x +c \right )} a^{2} b^{2}}{4 d}+\frac {b^{4} \ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right )}{d}-\frac {b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {a^{3} b \cos \left (3 d x +3 c \right )}{3 d}+\frac {a \,b^{3} \cos \left (3 d x +3 c \right )}{3 d}+\frac {\sin \left (3 d x +3 c \right ) a^{4}}{12 d}-\frac {\sin \left (3 d x +3 c \right ) a^{2} b^{2}}{2 d}+\frac {\sin \left (3 d x +3 c \right ) b^{4}}{12 d}\) \(319\)

input
int(sec(d*x+c)*(cos(d*x+c)*a+b*sin(d*x+c))^4,x,method=_RETURNVERBOSE)
 
output
1/d*(1/3*a^4*(2+cos(d*x+c)^2)*sin(d*x+c)-4/3*a^3*b*cos(d*x+c)^3+2*a^2*b^2* 
sin(d*x+c)^3-4/3*a*b^3*(2+sin(d*x+c)^2)*cos(d*x+c)+b^4*(-1/3*sin(d*x+c)^3- 
sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c))))
 
3.1.80.5 Fricas [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 121, normalized size of antiderivative = 0.81 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=-\frac {24 \, a b^{3} \cos \left (d x + c\right ) - 3 \, b^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, b^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 8 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{3} - 2 \, {\left (2 \, a^{4} + 6 \, a^{2} b^{2} - 4 \, b^{4} + {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{6 \, d} \]

input
integrate(sec(d*x+c)*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="fricas")
 
output
-1/6*(24*a*b^3*cos(d*x + c) - 3*b^4*log(sin(d*x + c) + 1) + 3*b^4*log(-sin 
(d*x + c) + 1) + 8*(a^3*b - a*b^3)*cos(d*x + c)^3 - 2*(2*a^4 + 6*a^2*b^2 - 
 4*b^4 + (a^4 - 6*a^2*b^2 + b^4)*cos(d*x + c)^2)*sin(d*x + c))/d
 
3.1.80.6 Sympy [F]

\[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\int \left (a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}\right )^{4} \sec {\left (c + d x \right )}\, dx \]

input
integrate(sec(d*x+c)*(a*cos(d*x+c)+b*sin(d*x+c))**4,x)
 
output
Integral((a*cos(c + d*x) + b*sin(c + d*x))**4*sec(c + d*x), x)
 
3.1.80.7 Maxima [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 126, normalized size of antiderivative = 0.84 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=-\frac {8 \, a^{3} b \cos \left (d x + c\right )^{3} - 12 \, a^{2} b^{2} \sin \left (d x + c\right )^{3} + 2 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{4} - 8 \, {\left (\cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )} a b^{3} + {\left (2 \, \sin \left (d x + c\right )^{3} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right ) + 6 \, \sin \left (d x + c\right )\right )} b^{4}}{6 \, d} \]

input
integrate(sec(d*x+c)*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="maxima")
 
output
-1/6*(8*a^3*b*cos(d*x + c)^3 - 12*a^2*b^2*sin(d*x + c)^3 + 2*(sin(d*x + c) 
^3 - 3*sin(d*x + c))*a^4 - 8*(cos(d*x + c)^3 - 3*cos(d*x + c))*a*b^3 + (2* 
sin(d*x + c)^3 - 3*log(sin(d*x + c) + 1) + 3*log(sin(d*x + c) - 1) + 6*sin 
(d*x + c))*b^4)/d
 
3.1.80.8 Giac [A] (verification not implemented)

Time = 0.38 (sec) , antiderivative size = 217, normalized size of antiderivative = 1.45 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {3 \, b^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, b^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (3 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 2 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 10 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, a^{3} b - 8 \, a b^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{3 \, d} \]

input
integrate(sec(d*x+c)*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="giac")
 
output
1/3*(3*b^4*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*b^4*log(abs(tan(1/2*d*x 
+ 1/2*c) - 1)) + 2*(3*a^4*tan(1/2*d*x + 1/2*c)^5 - 3*b^4*tan(1/2*d*x + 1/2 
*c)^5 - 12*a^3*b*tan(1/2*d*x + 1/2*c)^4 + 2*a^4*tan(1/2*d*x + 1/2*c)^3 + 2 
4*a^2*b^2*tan(1/2*d*x + 1/2*c)^3 - 10*b^4*tan(1/2*d*x + 1/2*c)^3 - 24*a*b^ 
3*tan(1/2*d*x + 1/2*c)^2 + 3*a^4*tan(1/2*d*x + 1/2*c) - 3*b^4*tan(1/2*d*x 
+ 1/2*c) - 4*a^3*b - 8*a*b^3)/(tan(1/2*d*x + 1/2*c)^2 + 1)^3)/d
 
3.1.80.9 Mupad [B] (verification not implemented)

Time = 26.10 (sec) , antiderivative size = 190, normalized size of antiderivative = 1.27 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {2\,b^4\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {\frac {16\,a\,b^3}{3}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (2\,a^4-2\,b^4\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {4\,a^4}{3}+16\,a^2\,b^2-\frac {20\,b^4}{3}\right )+\frac {8\,a^3\,b}{3}-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^4-2\,b^4\right )+16\,a\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]

input
int((a*cos(c + d*x) + b*sin(c + d*x))^4/cos(c + d*x),x)
 
output
(2*b^4*atanh(tan(c/2 + (d*x)/2)))/d - ((16*a*b^3)/3 - tan(c/2 + (d*x)/2)^5 
*(2*a^4 - 2*b^4) - tan(c/2 + (d*x)/2)^3*((4*a^4)/3 - (20*b^4)/3 + 16*a^2*b 
^2) + (8*a^3*b)/3 - tan(c/2 + (d*x)/2)*(2*a^4 - 2*b^4) + 16*a*b^3*tan(c/2 
+ (d*x)/2)^2 + 8*a^3*b*tan(c/2 + (d*x)/2)^4)/(d*(3*tan(c/2 + (d*x)/2)^2 + 
3*tan(c/2 + (d*x)/2)^4 + tan(c/2 + (d*x)/2)^6 + 1))